/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import com.mojang.authlib.GameProfile;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import javax.annotation.Nullable;
/*     */ import net.minecraft.block.state.IBlockState;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.renderer.DestroyBlockProgress;
/*     */ import net.minecraft.client.renderer.GlStateManager;
/*     */ import net.minecraft.client.renderer.RenderGlobal;
/*     */ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
/*     */ import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
/*     */ import net.minecraft.tileentity.TileEntity;
/*     */ import net.minecraft.tileentity.TileEntitySkull;
/*     */ import net.minecraft.util.EnumFacing;
/*     */ import net.minecraft.util.math.BlockPos;
/*     */ import net.minecraftforge.fml.relauncher.ReflectionHelper;
/*     */ 
/*     */ public class lt
/*     */   extends TileEntitySkullRenderer {
/*     */   public static TileEntitySkullRenderer w;
/*  23 */   private static final TileEntitySkullRenderer q = new TileEntitySkullRenderer();
/*     */   
/*     */   static {
/*  26 */     q.func_147497_a(TileEntityRendererDispatcher.field_147556_a);
/*     */   }
/*     */   
/*     */   private static Map<Integer, DestroyBlockProgress> g;
/*     */   
/*     */   public void func_192841_a(TileEntitySkull tileEntitySkull, double d1, double d2, double d3, float f1, int i, float f2) {
/*  32 */     float f3 = (tileEntitySkull.func_145906_b() * 360) / 16.0F;
/*  33 */     EnumFacing enumFacing = EnumFacing.func_82600_a(tileEntitySkull.func_145832_p() & 0x7);
/*  34 */     float f4 = tileEntitySkull.func_184295_a(f1);
/*     */ 
/*     */     
/*  37 */     String str = cx.v((TileEntity)tileEntitySkull);
/*     */ 
/*     */ 
/*     */     
/*  41 */     if (str != null && str.startsWith("none")) {
/*     */       return;
/*     */     }
/*  44 */     ex ex = cx.v((TileEntity)tileEntitySkull);
/*     */ 
/*     */     
/*  47 */     if (ex != null) {
/*     */       
/*  49 */       if (i >= 0) {
/*     */         return;
/*     */       }
/*  52 */       List<BlockPos> list = ex.v(tileEntitySkull.func_174877_v(), f3);
/*  53 */       if (list != null) {
/*  54 */         for (BlockPos blockPos : list) {
/*  55 */           IBlockState iBlockState = tileEntitySkull.func_145831_w().func_180495_p(blockPos);
/*  56 */           if (iBlockState.func_191057_i()) {
/*  57 */             DestroyBlockProgress destroyBlockProgress = getDestroyStage(blockPos);
/*  58 */             if (destroyBlockProgress != null) {
/*  59 */               i = Math.max(destroyBlockProgress.func_73106_e(), i);
/*     */             }
/*     */           } 
/*     */         } 
/*     */       }
/*     */ 
/*     */       
/*  66 */       func_188190_a((float)d1, (float)d2, (float)d3, enumFacing, f3, 0, tileEntitySkull.func_152108_a(), -1, f4);
/*  67 */       if (i >= 0)
/*     */       {
/*  69 */         func_188190_a((float)d1, (float)d2, (float)d3, enumFacing, f3, 0, tileEntitySkull.func_152108_a(), i, f4);
/*     */       }
/*     */     } else {
/*  72 */       q.func_192841_a(tileEntitySkull, d1, d2, d3, f1, i, f2);
/*     */     } 
/*     */   }
/*     */ 
/*     */   
/*     */   public void func_147497_a(TileEntityRendererDispatcher tileEntityRendererDispatcher) {
/*  78 */     super.func_147497_a(tileEntityRendererDispatcher);
/*  79 */     w = this;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void func_188190_a(float x, float y, float z, EnumFacing facing, float rotationIn, int skullType, @Nullable GameProfile profile, int destroyStage, float a) {
/*  87 */     String str = (profile != null && profile.getName() != null) ? profile.getName() : null;
/*  88 */     ex ex = ex.v(str);
/*     */ 
/*     */     
/*  91 */     if (ex != null) {
/*  92 */       String str1 = ex.i;
/*     */       
/*  94 */       ld ld = gp.v(str1);
/*     */       
/*  96 */       gp.v((int)x, (int)y, (int)z, str1, ld, "idle");
/*     */       
/*  98 */       if (destroyStage >= 0) {
/*  99 */         Minecraft.func_71410_x().func_110434_K().func_110577_a(field_178460_a[destroyStage]);
/* 100 */         GlStateManager.func_179128_n(5890);
/* 101 */         GlStateManager.func_179094_E();
/* 102 */         GlStateManager.func_179152_a(4.0F, 2.0F, 1.0F);
/* 103 */         GlStateManager.func_179109_b(0.0625F, 0.0625F, 0.0625F);
/* 104 */         GlStateManager.func_179128_n(5888);
/*     */       } else {
/* 106 */         gp.v(str1);
/*     */       } 
/*     */       
/* 109 */       GlStateManager.func_179094_E();
/* 110 */       GlStateManager.func_179129_p();
/*     */       
/* 112 */       GlStateManager.func_179109_b(x + 0.5F, y, z + 0.5F);
/*     */       
/* 114 */       GlStateManager.func_179091_B();
/* 115 */       GlStateManager.func_179152_a(-1.0F, -1.0F, 1.0F);
/* 116 */       GlStateManager.func_179141_d();
/*     */       
/* 118 */       GlStateManager.func_179114_b(rotationIn, 0.0F, 1.0F, 0.0F);
/*     */       
/* 120 */       ld.render(0.0625F);
/* 121 */       ld.clearData();
/* 122 */       GlStateManager.func_179121_F();
/*     */       
/* 124 */       if (destroyStage >= 0) {
/* 125 */         GlStateManager.func_179128_n(5890);
/* 126 */         GlStateManager.func_179121_F();
/* 127 */         GlStateManager.func_179128_n(5888);
/*     */       } 
/*     */     } else {
/* 130 */       q.func_188190_a(x, y, z, facing, rotationIn, skullType, profile, destroyStage, a);
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public DestroyBlockProgress getDestroyStage(BlockPos blockPos) {
/* 137 */     if (g == null) {
/* 138 */       g = (Map<Integer, DestroyBlockProgress>)ReflectionHelper.getPrivateValue(RenderGlobal.class, (Minecraft.func_71410_x()).field_71438_f, new String[] { "damagedBlocks", "field_72738_E" });
/*     */     }
/* 140 */     return g.values().stream().filter(destroyBlockProgress -> destroyBlockProgress.func_180246_b().equals(a)).findFirst().orElse(null);
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\lt.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */